1. Field of the Invention
The present invention relates to a method and an apparatus for recording/reproducing information in which an optical disk is used as an information recording medium.
2. Description of the Prior Art
The operation of a conventional information recording reproducing apparatus is described below.
FIG. 8 is a construction view showing the conventional information recording reproducing apparatus, using UNIX as an operating system, in which a host system 8100 is connected with a magnetic disk device 8200 serving as an external memory via a system bus 8300.
The host system 8100 comprises a CPU 8101, a main memory 8102, a disk cache 8103, and an interface circuit 8104. The main memory 8102 stores a plurality of programs and data. The CPU 8101 reads out the data and the programs stored in the main memory 8102 into execution. The disk cache 8103 is a memory for making input/output processings at a high speed. The input and output of data between the host system 8100 and the external memory is carried out via the disk cache 8103. The interface circuit 8104 connects the host system 8100 to the system bus 8300.
The magnetic disk device 8200 accommodates an information recording medium 8201. The information recording medium 8201 is logically divided into three partitions a, b, and c and a file system is constructed in each partition.
The recording reproducing operation of the data in the conventional information recording reproducing of the above construction is described below.
The CPU 8101 reads out the program from the main memory 8102 into an execution. When the writing of data on the partition (a) of the information recording medium 8201 is necessary in this process, the CPU 8101 opens the partition (a) in read/write mode. In the open processing, the CPU 8101 reads out the management information required in controlling the file from the information recording medium 8201 via the interface circuit 8104.
Next, the CPU 8101 records data in the partition (a) of the information recording medium 8201. In the write processing of data, first, the CPU 8101 transfers data to be written to the disk cache 8103 from the main memory 8102.
When the CPU 8101 records the data from the main memory 8102 onto the information recording medium 8201, well-known write-back method is used. In this method, when data writing is required, the CPU 8101 stores data to be written into the information recording medium 8201 in the disk cache 8103. Then, the CPU 8101 writes the data stored in the disk cache 8103 into the information recording medium 8201 when a vacant region is necessary in the disk cache 8103, when the data is unnecessary in the host system 8100, or when a certain period of time has elapsed after the data is stored in the disk cache 8103. Meanwhile, when the read-out of the data is necessary, if data is on the cache the CPU 8101 reads out the data from the disk cache 8103, and data is not read out from the information recording medium 8201. If the data which is to be written on an address is on the disk cache, the CPU 8101 writes new data on the disk cache 8103. Therefore, the number of data writing on the information recording medium 8201 is reduced. Thus, the number of inputs/outputs is reduced and the operation for recording/reproducing of data is performed at a high speed.
When the data writing is unnecessary, the CPU 8101 closes the partition (a). In the closing processing, the CPU 8101 issues an instruction of writing all data on the disk cache 8103 into the partition (a) of the information recording medium 8201 and at the same time, the partition (a) is logically cut off.
Thus, the data recording on the partition (a) of the information recording medium 8201 is carried out only from the opening processing of the partition (a) until the closing processing thereof.
Next, the data read-out of the host system 8100 is described below. When the data read-out from the (b) partition of the information recording medium 8201 is necessary, the CPU 8101 opens the (b) partition in read-only mode. The CPU 8101 reads out management information from the (b) partition of the information recording medium 8201 in the opening processing.
Next, the CPU 8101 reads out data from the (b) partition. In the read-out processing of data, the CPU 8101 reads out data from the (b) partition of the information recording medium 8201 in the magnetic disk device 8200 and issues an instruction of storing the data thus read out in the disk cache 8103 and at the same time, this data is transferred to the main memory 8102.
When the read-out of data is unnecessary, the CPU 8101 closes the (b) partition. In this closing processing, the CPU 8101 abandons the data on the disk cache 8103 and cuts off the (b) partition logically.
Thus, the reproduction of the data from the (b) partition is performed only from the opening processing of the (b) partition until the closing processing thereof. Any data is not written into the partition which has been opened in read-only mode.
The partition which has been opened is not opened again without being closed or the partition which has been closed is not closed again without being opened.
Let it be supposed that the (a) partition of the information recording medium 8201 is opened in read/write mode and data to be written into the (a) partition exists on the disk cache 8103. If the power source of the host system 8100 is cut off, the data on the disk cache 8103 is lost and the data to be written is not written into the (a) partition. Therefore, in the (a) partition, an inconsistency occurs in the file system. For example, the inconsistency occurs in the file control information or the difference occurs between the file control information and the actuality of the file.
If the CPU 8101 opens the (a) partition again in read/write mode and writes data thereinto with inconsistency occurring in the file system, a file which already exists may be destroyed. When the CPU 8101 detects the inconsistency of the file management information, the system goes down.
In order to avoid this, the CPU 8101 checks the consistency of the file system generated in each partition of the information recording medium 8201 when the power source is turned on, namely, in boot time. If an inconsistency is detected, the consistency of the file system is corrected. In the file system in which the inconsistency has been corrected thus, an existing file is not destroyed or the system does not go down due to the inconsistency in the file system.
When an optical disk which is a removable information recording medium is used in such a host system, the termination time of input/output in the program and the termination time of an operation for actual recording data into an information recording medium does not coincide with each other. Therefore, an optical disk may be taken out before the partition is closed, namely, before data on the disk cache is recorded. In particular, a plurality of programs simultaneously run in the UNIX. Therefore, there is a high possibility that the optical disk is taken out before all programs write data into the optical disk.
The inconsistency of the file system exists in the optical disk taken out before all data are written into the disk. Since the optical disk is exchangeable, it may be incorporated in the system or replaced after boot. Therefore, when the optical disk is used in the above system, the consistency is not corrected in boot time even when an inconsistency exists in the file system, and the existing file is broken or a system-down occurs due to the inconsistency of the file system.
When the optical disk is replaced before data on the disk cache is recorded, namely, when the optical disk is taken out and then another optical disk is inserted into, data which should have been already written on the optical disk is written into another optical disk replaced.
In the optical disk, since ROM (read-only memory) disk is used or in the write protect condition by the setting of a write protecting button, there is a case in which data cannot be written. When a user performs a data writing operation into the optical disk, the user does not write data on the optical disk. Therefore, inconsistency occurs between the data in the disk cache 8103 and the data on the optical disk, which may cause a system-down.
Since in a 4.3 BSD UNIX system in particular, a magnetic disk device having physical sector size as 512 B (bytes) is assumed to be an external memory, a data access is performed in units of 512 bytes. For example, in a manual of SunOs 4.0 of Sun Microsystem Corp. which is a representative manufacturer of a UNIX work stations, the sector size is 512 B in the item of System & Network Administration.
The optical disk is usually provided with a guide track which can be optically detected so that laser beams are irradiated on a recording layer of the guide track and a change which can be optically detected is made to record information. In a general optical disk to be used for processing information, a track formed on the optical disk is divided into a plurality of sectors of a fixed length so that information is recorded and reproduced on a sector by sector basis. In the process of manufacturing such an optical disk, simultaneously with the formation of a guide track, address information showing the position of a sector on the disk is formed for every constant interval. That is, in the process of manufacturing the optical disk, the size of the sector is physically determined. In ISO two kinds of formats of 512 B and 1024 B are determined as the format of the optical disk having a diameter of 130 mm. In the optical disk, in order to secure reliability, data is recorded with an error correcting code so as to correct an error and reproduce data. Since the error correcting code is formed with one sector being a unit, an error is corrected on a sector by sector basis. Therefore, in the case of an optical disk having a sector size of 1024 B, data cannot be recorded or reproduced with 512 B being a unit.
However, in an optical disk having a sector size as 1024 B, compared with an optical disk having a sector size as 512 B, smaller number of control information such as address suffices on a disk. Therefore, more user data can be recorded. As such, under a system in which UNIX is an OS, there is a demand of using an optical disk having a sector size of 1024 B.
But as described previously, an optical disk in which sector size is 1024 B cannot be used under UNIX which performs a data access on 512 B.